<?php session_start();
include("db.php"); 
$_SESSION['msg1'] = "Logout";
$_SESSION['msg2'] = "Welcome, ".$_REQUEST['fname']."! | ";

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><!-- InstanceBegin template="Templates/Assn3_template.dwt" codeOutsideHTMLIsLocked="false" -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- InstanceBeginEditable name="doctitle" -->
<title>www.onestopjcu template</title>
<?php 
	// upon user click submit button
	if ( isset($_REQUEST['signup']) ) 
	{
$connection=mysql_connect("localhost", "root", ""); 

//Select database, database_name needs to be changed

		$myDB = new db();
		
		
		
		
		// check whether user exits already
		//$validUser = $myDB->validateUser($_POST['email']);

			// construct a insert query
			$id = $_REQUEST['id'];

			
			
			
		
			// echo $insert_query;
		
			$result = $myDB->sendSQLStatement("UPDATE `announcement` SET `first_name` ='".$_REQUEST['fname']."',`last_name` ='".$_REQUEST['lname']."', `email` ='".$_REQUEST['email']."', `phone` ='".$_REQUEST['phone']."', `title` ='".$_REQUEST['Title']."',`announ_content` ='".$_REQUEST['mention']."',`announ_date` = CURRENT_TIMESTAMP WHERE `announcement`.`announ_id` = '".$id."'")or die("Query failed: " . mysql_error());	

			
  header("location: announcement.php");
	} else {
		echo "window.history.back();";
	}
	

		

?>


<!-- InstanceEndEditable -->

<link href="Assn3_CSS.css" rel="stylesheet" type="text/css" />
</head>

<body>
<div class="container" id="top">

<div class="heads"><!-- heads -->
<div class="welcome">
<table>
<tr>
<td>
<?php  echo $_SESSION['msg2']; ?>
<a href="register.php"><?php  echo $_SESSION['msg1']; ?></a>
</td>
</tr>
</table>
</div>
</div>
<div class="menu">
  
  <div class="service"><ul><li><a href="home.php">Home</a></li></ul></div>
	

<div class="service"><ul><li><a href="member.php">Member</a>
<ul>
    	<li>
        	<h5 style="color:#FFF; text-align:left; font-family:Arial, Helvetica, sans-serif; padding-bottom: 10px; margin: 5px 0px 10px 0px; width:180px; height: 0px;"><a href="member.php" style="font-family:Arial, Helvetica, sans-serif; font-size:13px;">Member</a></h5><br/>            

        	<a href="register.php"><?php  echo $_SESSION['msgMember']; ?></a><br/>
    		
        </li>
    </ul>
</li></ul></div><!-- service -->

<div class="service"><ul><li><a href="Accommodation.php">Accommodation</a>
<ul>
    	<li>
        	<h5 style="color:#FFF; text-align:left; font-family:Arial, Helvetica, sans-serif; padding-bottom: 10px; margin: 5px 0px 10px 0px; width:180px; height: 0px;"><a href="Accommodation.php" style="font-family:Arial, Helvetica, sans-serif; font-size:13px;">Accommodation</a></h5><br/>            
			<a href="accommodation.php">Search Room</a><br/><br/>
        	<a href="Accom_newpost.php">Post New Advitisement</a><br/><br/>
            <a href="viewpost.php">View Your Posts</a><br/><br/>
       		
    		
        </li>
    </ul>
</li></ul></div><!-- service -->

<div class="service"><ul><li><a href="shopping.php">Selling Books</a>
<ul>
    	<li>
        	<h5 style="color:#FFF; text-align:left; font-family:Arial, Helvetica, sans-serif; padding-bottom: 10px; margin: 5px 0px 10px 0px; width:180px; height: 0px;"><a href="shopping.php" style="font-family:Arial, Helvetica, sans-serif; font-size:13px;">Selling Books</a></h5><br/>            

            <a href="shopping.php">Browse Books</a><br/><br/>
            <a href="shopping_newpost.php">Post New Books</a><br/><br />
             <a href="view_cart.php">View Your Carts</a><br/><br/>
       		
            
    		
        </li>
    </ul>
</li></ul></div><!-- service -->



<div class="service"><ul><li><a href="announcement.php">Announcement</a>
<ul>
    	<li>
        	<h5 style="color:#FFF; text-align:left; font-family:Arial, Helvetica, sans-serif; padding-bottom: 10px; margin: 5px 0px 10px 0px; width:180px; height: 0px;"><a href="announcement.php" style="font-family:Arial, Helvetica, sans-serif; font-size:13px;">Announcement</a></h5><br/>            

        	<a href="new_announce.php">Post New Announcement</a><br/><br/>
            <a href="viewmypost.php">View Your Posts</a><br /><br />
       		<a href="feedback.html">Feedback</a><br/>
    		
        </li>
    </ul>
</li></ul></div><!-- service -->

<div class="service"><ul><li><a href="aboutus.php">About us</a></li></ul></div><!-- service -->


<!-- InstanceBeginEditable name="phplogin" -->

<!-- InstanceEndEditable -->


</div><!-- menu -->


<!-- InstanceBeginEditable name="main" -->
<div class="main">
<br/>
<br/>
<h3 align="center">Thank you for registering with us.  Please enjoy our services!</h3>
</div><!-- main -->
<!-- InstanceEndEditable -->


<div class="footer"> 
<div style="margin-left:10px; float:left; font-family:Arial, Helvetica, sans-serif; font-weight:bold; font-size:12px; color:#FFF; width:430px; height:12px; margin-top:16px;">Copyright &copy; 2012 www.onestopjcu.com
</div>

<div style="margin-left:50px; float:left; font-family:Arial, Helvetica,sans-serif; font-weight:bold; font-size:11px; width:100px; height:12px; margin-top:16px;"><a href="#top" style="color:#FFF; text-decoration: none;">Return to Top</a>
</div>

<ul>
<li><a href="feedback.php">Feedback</a></li>
<li><a href="FAQ.php">FAQ</a></li>
<li><a href="aboutus.php" style="margin-right:24px;">About Us</a></li>
<li><a href="aboutus.php" style="margin-right:24px;">Contact Us</a></li>
</ul>




</div><!-- footer -->
</div><!-- container -->
</body>
<!-- InstanceEnd --></html>
